﻿<%- include('../../shared/includes/head',{ pageTitle: 'Signup' }) %>
</head>
<link rel="stylesheet" href="/styles/forms.css">
<link rel="stylesheet" href="/styles/auth.css">
<body>
<%- include('../../shared/includes/header') %>
<main>
    <h1>Create New Account</h1>
    <% if(inputData.errorMessage){ %>
        <section class="alert">
            <h2>Invalid Input</h2>
            <p><%= inputData.errorMessage %></p>
        </section>
    <% } %>
    <form action="/signup" method="POST">
        <input type="hidden" name="_csrf"
               value="<%= locals.csrfToken %>">
        <p>
            <label for="email">E-Mail</label>
            <input type="email" id="email"
                   name="email"
                   value="<%= inputData.email %>"
                   required>
        </p>
        <p>
            <label for="confirm-email">Confirm
                EMail</label>
            <input type="email" id="confirm-email"
                   name="confirm-email"
                   value="<%= inputData.confirmEmail %>"
                   required>
        </p>
        <p>
            <label for="password">Password</label>
            <input type="password" id="password"
                   name="password" minlength="6"
                   value="<%= inputData.password %>"
                   required>
        </p>
        <hr>
        <p>
            <label for="fullname">Full
                Name</label>
            <input type="text" id="fullname"
                   name="fullname"
                   value="<%= inputData.fullname %>"
                   required>
        </p>
        <p>
            <label for="street">Street</label>
            <input type="text" id="street"
                   name="street"
                   value="<%= inputData.street %>"
                   required>
        </p>
        <p>
            <label for="postal">Postal
                Code</label>
            <input type="text" id="postal"
                   name="postal" minlength="5"
                   maxlength="5"
                   value="<%= inputData.postal %>"
                   required>
        </p>
        <p>
            <label for="city">City</label>
            <input type="text" id="city"
                   name="city"
                   value="<%= inputData.city %>"
                   required>
        </p>
        <button class="btn">Create Account
        </button>
        <p id="switch-form"><a href="/login">Login
                instead</a></p>
    </form>
</main>

<%- include('../../shared/includes/footer') %>